﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SqlCe4Mvc3Application1.Models
{
    public partial class _Containers_ContainerPartRecord : RaisingStudio.Data.Expressions.TableExpression, RaisingStudio.Data.Expressions.IQueryExpression<_Containers_ContainerPartRecord>
    {
        #region Constructor (s) / Destructor
        /// <summary>
        /// Constructor (s) / Destructor.
        /// </summary>
        public _Containers_ContainerPartRecord() : base("Containers_ContainerPartRecord")
        {
        }
        #endregion
        #region Members
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Id = "Id";
        public RaisingStudio.Data.Expressions.ColumnExpression Id { get { return _Id; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Paginated = "Paginated";
        public RaisingStudio.Data.Expressions.ColumnExpression Paginated { get { return _Paginated; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _PageSize = "PageSize";
        public RaisingStudio.Data.Expressions.ColumnExpression PageSize { get { return _PageSize; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _OrderByProperty = "OrderByProperty";
        public RaisingStudio.Data.Expressions.ColumnExpression OrderByProperty { get { return _OrderByProperty; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _OrderByDirection = "OrderByDirection";
        public RaisingStudio.Data.Expressions.ColumnExpression OrderByDirection { get { return _OrderByDirection; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _ItemContentType = "ItemContentType";
        public RaisingStudio.Data.Expressions.ColumnExpression ItemContentType { get { return _ItemContentType; } }

		#endregion

        public static implicit operator RaisingStudio.Data.Expressions.ConditionExpression(_Containers_ContainerPartRecord Containers_ContainerPartRecord)
        {
            return new RaisingStudio.Data.Expressions.ConditionExpression();
        }

        public RaisingStudio.Data.Expressions.ConditionExpression OrderBy(RaisingStudio.Data.Expressions.ColumnExpression columnExpression)
        {
             RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
             return conditionExpression.OrderBy(columnExpression);
        }

        public RaisingStudio.Data.Expressions.ConditionExpression OrderBy(RaisingStudio.Data.Expressions.ColumnExpression columnExpression, RaisingStudio.Data.Expressions.SortingDirection sortingDirection)
        {
            RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
            return conditionExpression.OrderBy(columnExpression, sortingDirection);
        }

        public RaisingStudio.Data.Expressions.ConditionExpression Where(RaisingStudio.Data.Expressions.ExpressionElement expressionElement)
        {
            RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
            return conditionExpression.Where(expressionElement);
        }

        public static implicit operator RaisingStudio.Data.Expressions.ColumnExpressionCollection(_Containers_ContainerPartRecord Containers_ContainerPartRecord)
        {
            return new RaisingStudio.Data.Expressions.ColumnExpressionCollection(Containers_ContainerPartRecord);
        }

        public static implicit operator RaisingStudio.Data.Expressions.ColumnExpression[](_Containers_ContainerPartRecord Containers_ContainerPartRecord)
        {
            return new RaisingStudio.Data.Expressions.ColumnExpression[]
                        {                            
                            Containers_ContainerPartRecord.Id,
                            Containers_ContainerPartRecord.Paginated,
                            Containers_ContainerPartRecord.PageSize,
                            Containers_ContainerPartRecord.OrderByProperty,
                            Containers_ContainerPartRecord.OrderByDirection,
                            Containers_ContainerPartRecord.ItemContentType,
                        };
        }

        public RaisingStudio.Data.Expressions.ColumnExpressionCollection Except(params RaisingStudio.Data.Expressions.ColumnExpression[] columns)
        {
            RaisingStudio.Data.Expressions.ColumnExpressionCollection columnExpressionCollection = this;
            return columnExpressionCollection.Except(columns);
        }

    
        public static implicit operator RaisingStudio.Data.Expressions.QueryExpression<_Containers_ContainerPartRecord>(_Containers_ContainerPartRecord Containers_ContainerPartRecord)
        {
            return new RaisingStudio.Data.Expressions.QueryExpression<_Containers_ContainerPartRecord>(Containers_ContainerPartRecord);
        }


        #region IQueryExpression<_Containers_ContainerPartRecord> 成员

        _Containers_ContainerPartRecord RaisingStudio.Data.Expressions.IQueryExpression<_Containers_ContainerPartRecord>.Value
        {
            get { return Containers_ContainerPartRecord._; }
        }

        #endregion

        #region IQueryExpression 成员

        RaisingStudio.Data.Expressions.TableExpression RaisingStudio.Data.Expressions.IQueryExpression.Table
        {
            get { return this; }
        }

        RaisingStudio.Data.Expressions.ConditionExpression RaisingStudio.Data.Expressions.IQueryExpression.Condition
        {
            get { return this; }
        }

        RaisingStudio.Data.Expressions.ColumnExpressionCollection RaisingStudio.Data.Expressions.IQueryExpression.Columns
        {
            get { return null; }
        }

        #endregion
    }

    partial class Containers_ContainerPartRecord
    {
        #region Members
        public static readonly _Containers_ContainerPartRecord _ = new _Containers_ContainerPartRecord();
		#endregion
    }
}
